Feature: Quote page - Get Find Doctor URL

  @happy 
  Scenario: All the fields are valid - Get find doctor url
    When I send a POST request to "provider/getFindDoctorUrl"
      """
      {
      "zipCode": "98001",
      "state": "KING",
      "carrierId": "9811",
      "planId": "200031",
      "planName": "Flex Bronze",
      "categoryName": "HMO",
      "directoryUrl": "https://www1.ghc.org/html/public/services/provider-directory.html",
      "logoUrl": "//static.qp.ehealthinsurance.com/ehealthinsurance/CarrierProfile/littlelogos/9811.gif",
      "network": "Group Health Core"
      }
      """
    Then the response status should be 200
    And the JSON response should be
      """
      {
      "findDoctorUrl": "/ehi/provider-search/search?mode=standard&planurl=Y&src=QLC&zipcode=98001&carrierid=9811&planId=200031&plantype=HMO&network=Group Health Core&planname=Flex Bronze&logourl=/ehealthinsurance/CarrierProfile/littlelogos/9811.gif"
      }
      """

  @sad 
  Scenario Outline: zipCode,state,planName,directoryUrl,logoUrl Validation
    When I send a POST request to "provider/getFindDoctorUrl"
      """
      {
      "zipCode": <zipCode>,
      "state": <state>,
      "carrierId": "9811",
      "planId": "200031",
      "planName": <planName>,
      "categoryName": "HMO",
      "directoryUrl": <directoryUrl>,
      "logoUrl": <logoUrl>,
      "network": "Group Health Core"
      }
      """
    Then the response status should be 400
    And the error message should be "Invalid find doctor contenxt, find doctor contenxt info is incomplete."

    Examples: 
      | zipCode | state  | planName      | directoryUrl                                                        | logoUrl                                                                                 |
      | ""      | "KING" | "Flex Bronze" | "https://www1.ghc.org/html/public/services/provider-directory.html" | "//static.qp.ehealthinsurance.com/ehealthinsurance/CarrierProfile/littlelogos/9811.gif" |
      | "98001" | ""     | "Flex Bronze" | "https://www1.ghc.org/html/public/services/provider-directory.html" | "//static.qp.ehealthinsurance.com/ehealthinsurance/CarrierProfile/littlelogos/9811.gif" |
      | "98001" | "KING" | ""            | "https://www1.ghc.org/html/public/services/provider-directory.html" | "//static.qp.ehealthinsurance.com/ehealthinsurance/CarrierProfile/littlelogos/9811.gif" |
      | "98001" | "KING" | "Flex Bronze" | ""                                                                  | "//static.qp.ehealthinsurance.com/ehealthinsurance/CarrierProfile/littlelogos/9811.gif" |
      | "98001" | "KING" | "Flex Bronze" | "https://www1.ghc.org/html/public/services/provider-directory.html" | ""                                                                                      |

  @sad 
  Scenario Outline: carrierId,planId,categoryName,network Validation
    When I send a POST request to "provider/getFindDoctorUrl"
      """
      {
      "zipCode": "98001",
      "state": "KING",
      "carrierId": <carrierId>,
      "planId": <planId>,
      "planName": "Flex Bronze",
      "categoryName": <categoryName>,
      "directoryUrl": "https://www1.ghc.org/html/public/services/provider-directory.html",
      "logoUrl": "//static.qp.ehealthinsurance.com/ehealthinsurance/CarrierProfile/littlelogos/9811.gif",
      "network": <network>
      }
      """
    Then the response status should be 400
    And the error message should be <errorMessage>

    Examples: 
      | carrierId | planId     | categoryName | network             | errorMessage                                                             |
      | ""        | "200031"   | "HMO"        | "Group Health Core" | "Invalid find doctor contenxt, find doctor contenxt info is incomplete." |
      | "9811dd"  | "200031"   | "HMO"        | "Group Health Core" | "CarrierId is invalid."                                                  |
      | "9811"    | ""         | "HMO"        | "Group Health Core" | "Invalid find doctor contenxt, find doctor contenxt info is incomplete." |
      | "9811"    | "200031dd" | "HMO"        | "Group Health Core" | "PlanId is invalid."                                                     |
      | "9811"    | "200031"   | ""           | "Group Health Core" | "Invalid find doctor contenxt, find doctor contenxt info is incomplete." |
      | "9811"    | "200031"   | "HMO"        | ""                  | "Invalid find doctor contenxt, find doctor contenxt info is incomplete." |

  @happy 
  Scenario Outline: carrierId,planId,categoryName,network combination is incorrect - System return directory url as find doctor link
    When I send a POST request to "provider/getFindDoctorUrl"
      """
      {
      "zipCode": "98001",
      "state": "KING",
      "carrierId": <carrierId>,
      "planId": <planId>,
      "planName": "Flex Bronze",
      "categoryName": <categoryName>,
      "directoryUrl": "https://www1.ghc.org/html/public/services/provider-directory.html",
      "logoUrl": "//static.qp.ehealthinsurance.com/ehealthinsurance/CarrierProfile/littlelogos/9811.gif",
      "network": <network>
      }
      """
    Then the response status should be 200
    And the JSON response should be
      """
      {
      "findDoctorUrl": "https://www1.ghc.org/html/public/services/provider-directory.html"
      }
      """

    Examples: 
      | carrierId  | planId   | categoryName | network                    |
      | "70100300" | "200031" | "HMO"        | "Group Health Core"        |
      | "9720"     | "80"     | "HMO"        | "Northwest Kaiser Network" |
      | "9811"     | "200031" | "PPO"        | "Group Health Core"        |
      | "9811"     | "200031" | "HMO"        | "Northwest Kaiser Network" |
